	var base_url = 'http://' + window.location.hostname + '/' + window.location.pathname.split('/')[1] + '/';
	var upload_url = base_url + 'index.php/backend/admin/import_scheduler_upload';
	
	function dateobj_to_str(dateobj) {
		var year = dateobj.getFullYear().toString();
		
		var real_month = dateobj.getMonth() + 1;
		var month = real_month.toString();
		if (real_month.toString().length < 2) {
			month = '0' + real_month;
		}
		
		var date = dateobj.getDate().toString();
		if (dateobj.getDate().toString().length < 2) {
			date = '0' + dateobj.getDate();
		}
		
		return year + '-' + month + '-' + date;
	}
	
	function load_sel_airport(argv) {
		if (argv['type'] == 'from') {
			var sel_airport_json_obj = eval('(' + sel_airport_json +')');
			for (x in sel_airport_json_obj) {
				var airport_id = sel_airport_json_obj[x]['from_airport']['id'];
				var airport_code = sel_airport_json_obj[x]['from_airport']['airport_code'];
				var airport_name = sel_airport_json_obj[x]['from_airport']['airport_name'];
				var airport_area_name = sel_airport_json_obj[x]['from_airport']['area']['name'];
				
				var option_content = airport_name + ((airport_area_name != airport_name) ? (' / ' + airport_area_name) : '') + ' (' + airport_code + ')';
				
				$sel_airport.find('select#sel_from_airport').append('<option value="' + airport_id + '">' + option_content + '</option>');
			}
		} else if (argv['type'] == 'to') {
			$sel_airport.find('select#sel_to_airport').html('<option value="">---Select City---</option>');
			
			var sel_airport_json_obj = eval('(' + sel_airport_json +')');
			for (x in sel_airport_json_obj) {
				if (sel_airport_json_obj[x]['from_airport']['id'] == argv['fa_id']) {
					var to_airports = sel_airport_json_obj[x]['to_airport'];
					
					for (y in to_airports) {
						var airport_id = to_airports[y]['id'];
						var airport_code = to_airports[y]['airport_code'];
						var airport_name = to_airports[y]['airport_name'];
						var airport_area_name = to_airports[y]['area']['name'];
						
						var option_content = airport_name + ((airport_area_name != airport_name) ? (' / ' + airport_area_name) : '') + ' (' + airport_code + ')';
						
						$sel_airport.find('select#sel_to_airport').append('<option value="' + airport_id + '">' + option_content + '</option>');
					}
					
					break;
				}
			}
		}
	}
	
	function showProgressBar() {
		$(".upload").find(".progress").css({ 'visibility': 'visible' });
	}
	
	function hideProgressBar() {
		$(".upload").find(".progress").css({ 'visibility': 'hidden' }).find(".bar").css({ 'width': '0%' });
	}
	
	// set default options for blockUI   onclick="location.replace(location.href);"
	//$.blockUI.defaults.message = '';
	
	//$.blockUI.defaults.css.width = '';
	$.blockUI.defaults.css.border = null;
	
	$.blockUI.defaults.overlayCSS.background = 'url("./../../images/bg.gif")';
	$.blockUI.defaults.overlayCSS.opacity = 0.6;
	$.blockUI.defaults.overlayCSS.cursor = null;
	
	
	
	
	
	
	